#pragma once
#include "Log.hpp"
#include "Socket.hpp"


class TcpServer
{
public:
    TcpServer(const uint16_t& port)
        :port_(port)
    {}

    bool InitServer()
    {
        listensock_.Socket();
        listensock_.Bind(port_);
        listensock_.Listen();
    }

    void Start()
    {
        std::string clientip;
        uint16_t clientport;
        while(true)
        {
            int sockfd = listensock_.Accept(&clientip, &clientport);
        }
    }
private:
    uint16_t port_;
    Sock listensock_;
};